package com.oly.cms.general.taglib;

import java.util.List;

import com.oly.cms.general.model.po.WebTag;
import com.oly.cms.general.service.cache.WebTagCacheService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 如果为列表，默认获取第一页
 */
@Service("tagTag")
public class TagTag {
    @Autowired
    private WebTagCacheService tagCacheService;

    /****
     * 通过id获取标签信息
     * 
     * @param tagId 标签ID
     * @return
     */
    public WebTag getTagById(long tagId) {
        return tagCacheService.getWebTagByTagId(tagId);
    }

    /**
     * 
     * @param tagType
     * @return
     */
    public List<WebTag> listTagByType(Integer tagType) {
        return tagCacheService.listWebTagsByType(tagType);
    }

    /**
     * 获取推荐标签
     * 
     * @param visible   状态
     * @param themeName 主题名字
     * @return
     */
    public List<WebTag> listTagByVisible(Integer visible, String themeName) {
        return tagCacheService.listWebTagsByVisible(visible, themeName);
    }

    /**
     * @param tagType   类型
     * @param visible   状态
     * @param themeName 主题名字
     * @return
     */
    public List<WebTag> listTagByTypeAndVisible(Integer tagType, Integer visible, String themeName) {
        return tagCacheService.listWebTagsByTypeAndVisible(tagType, visible, themeName);
    }

}
